extends Node

export(NodePath) var x_axis_path
export(NodePath) var y_axis_path

var x_axis
var y_axis

func _ready():
	x_axis = get_node(x_axis_path)
	y_axis = get_node(y_axis_path)
	
func _process(delta):
	#Movement
	var rot = get_input()
	y_axis.rotate_y(rot.x*delta)
	x_axis.rotate_x(rot.y*delta)
	
func get_input():
	var rot = Vector2.ZERO
	if Input.is_action_pressed("ui_left"):
		rot.x += 1
	if Input.is_action_pressed("ui_right"):
		rot.x -= 1
	if Input.is_action_pressed("ui_up"):
		rot.y += 1
	if Input.is_action_pressed("ui_down"):
		rot.y -= 1;
	return rot
